﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Quizz.DataRepository.Models;
using Quizz.Service.Services;

namespace Quizz.QuizzProjectService
{
    public partial class QuizzProjectService
    {
        public Property PropertyGetById(long id){
            using (var service = new PropertyService())
            {
                return service.GetById(id);
            }
        }

        public IList<Property> PropertyGetAll(){
            using (var service = new PropertyService())
            {
                return service.GetAll().ToList();
            }
        }

        public IList<Property> PropertyGetByType(int type){
            using (var service = new PropertyService())
            {
                return service.GetByType(type).ToList();
            }
        }

        public Property PropertyGetByName(string name){
            using (var service = new PropertyService())
            {
                return service.GetByName(name);
            }
        }

        public void PropertyInsert(Property property){
            using (var service = new PropertyService())
            {
                service.Insert(property);
            }
        }
        
        public void PropertyUpdate(Property property){
            using (var service = new PropertyService())
            {
                service.Update(property);
            }
        }

        public void PropertyDelete(long id){
            using (var service = new PropertyService())
            {
                service.Delete(id);
            }
        }
    }
}